<template>
  <div class="c-pb32 c-bg-sgray c-p">
    <div class="c-pt60 c-pb48 c-flex-column c-flex-center">
      <img class="c-ww100 c-hh100 c-brp50" :src="$addXossFilter(appLogo, require('@/assets/i/wap/member/default_logo.png'))" alt="">
      <div class="c-mt16 c-fw600 c-fc-xblack c-fs22">{{appName}}</div>
    </div>
    <div @click="linkToProtocol(protocolInfo.privacyProtocolUrl)" class="c-bg-white c-hh100 c-flex-row  c-aligni-center c-fs26 c-ph24 c-bd-b1">
      <div>隐私政策</div>
      <div class="c-fc-gray c-flex-grow1 c-textAlign-r"></div>
      <i class="iconfont c-fs20 c-fc-sgray">&#xe60e;</i>
    </div>
    <div @click="linkToProtocol(protocolInfo.useProtocolUrl)" class="c-bg-white c-hh100 c-flex-row  c-aligni-center c-fs26 c-ph24 c-bd-b1">
      <div>用户协议</div>
      <div class="c-fc-gray c-flex-grow1 c-textAlign-r"></div>
      <i class="iconfont c-fs20 c-fc-sgray">&#xe60e;</i>
    </div>
    <div class="c-pa c-p-b60 c-w100 c-flex-column c-flex-center c-fc-sgray c-fs22">
      <div>Copyright@2022  {{companyName}}</div>
      <div class="c-mt10">ALL RIghts Reserved</div>
    </div>
  </div>
</template>

<script>
import { utilJs } from "@/utils/common.js";
export default {
  name: "AboutUs",
  components: {
  },
  props: [],
  data() {
    return {
      theme: localStorage.getItem("colorName") ? localStorage.getItem("colorName") : 'mb5_default',
      isAndroidApp: false,
      isiOSApp: false,
      protocolInfo: null, // 通用协议
      appLogo: '', // app logo
      companyName: '', // 公司名称
      appName: '', // app名称
    };
  },
  computed: {
  },
  created() {
  },
  methods: {
    linkToProtocol(url) {
      if (!url) return
      window.location.href = url;
    },
    getAppUseAndPrivacyProtocols() {
      utilJs.getMethod(`${global.apiurl}app/getAppUseAndPrivacyProtocols`, (res) => {
        this.protocolInfo = res || null;
        this.appLogo = res.appLogo || '';
        this.companyName = res.companyName || '';
        this.appName = res.appName || '';
      });
    },
  },
  activated() {
    this.isAndroidApp = utilJs.isAndroidApp();
    this.isiOSApp = utilJs.isIOSAppALL();
    setDocumentTitle("关于我们");
    this.appLogo = '';
    this.companyName = '';
    this.appName = '';
    if (this.isAndroidApp || this.isiOSApp) {
      this.getAppUseAndPrivacyProtocols();
    }
  }
};
</script>

<!-- Add "scoped" attribute to limit CSS to this component only -->
<style scoped>
.c-mt400 {
  margin-top: 10rem;
}
</style>
